package com.beesphere.excel.writer.style.resolvers;

import java.lang.reflect.Method;

import com.beesphere.excel.writer.impls.WorkbookContext;

public class ShortResolver extends MethodBasedStyleResolver {

	private static final long serialVersionUID = -6011494566385503986L;

	public ShortResolver(Method method) {
		super(method);
	}
	
	@Override
	protected Object getValue(WorkbookContext workbookContext, Object applyTo, Object value) {
		if (value == null) {
			return null;
		}
		return (short)Integer.parseInt(String.valueOf(value));
	}
}
